package com.hsgene.gateway.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.common.util.web.session.UserInfo;
import com.hsgene.gateway.service.api.impl.LoginCheckServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 登录校验
 *
 * @author wangbing
 * @version 1.0, 2018/7/19
 */
@FeignClient(value = "ms-mod-user", path = "/1.0/genetic/testing/checking", fallback = LoginCheckServiceImpl.class)
public interface LoginCheckService {

    /**
     * 用户登录状态校验
     *
     * @param sessionId   会话标识
     * @param accessToken 访问令牌
     * @return 校验结果
     */
    @GetMapping("login/status")
    ApiResult<UserInfo> checkLoginStatus(
            @RequestParam(name = "sessionId", required = false) String sessionId,
            @RequestParam(name = "accessToken", required = false) String accessToken);
}
